package Competition;

import org.junit.Test; /**
 * @BelongsProject: SeniorArchitect-LeetCode
 * @BelongsPackage: Competition
 * @Author: zhuangxiaoyan
 * @CreateTime: 2023-11-12  10:49
 * @Description: TODO
 * @Version: 1.0
 */
public class 找出强数对的最大异或值I {

    public int maximumStrongPairXor(int[] nums) {
        int result=0;
        for (int i=0;i<nums.length;i++){
            for ( int j=i+1;j<nums.length;j++){
                if (Math.abs(nums[i]-nums[j])<=Math.min(nums[i],nums[j])){
                    result=Math.max(result,nums[i]^nums[j]);
                }
            }
        }
        return result;
    }

    @Test
    public  void test(){
        int i = maximumStrongPairXor(new int[]{10,100});
        System.out.println(i);
    }
}
